﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using CRUD.DAO;
using CapaGestion.Spring;
using GestionadorBaseDatos;
using System.Web.UI.MobileControls;
using CapaNegocios;



using Spring.Context.Support;
using Spring.Data;
using Spring.Context;
public partial class login : Base
{
    protected void Page_Load(object sender, EventArgs e)
    {
        Session["load"] = "true";
    }
    protected void IngresarUsuario(object sender, EventArgs e)
    {

        IGestionUsuario gestionUsuario = AdministradorGestion.getGestionarUsuario();

   
        Usuario usu = new Usuario();
        usu.Nickname = txtUsuario.Text;
        usu.Password = box.Text;
        usu = gestionUsuario.ObtenerUsuario(usu);
        
        
        if (usu.Nombre == null)
        {
             
           
            mensaje.alert("Usuario o contraseña incorrectos");
            }
        else
        {
            Session["login"] = usu;
            Response.Redirect("Inicio.aspx");
        }
        
    }
    
    protected void IrRegistroUsuario(object sender, EventArgs e)
    {
        this.Response.Redirect("RegistroUsuario.aspx");

    }
    protected void IrRecover(object sender, EventArgs e)
    {
        this.Response.Redirect("Recover.aspx");

    }
}
